<template>
  <div class="index-page">
    <div class="index-main">
      <Map />
      <div class="index-title">
        <Title />
      </div>
    </div>
  </div>
</template>

<script>
import Title from "./layout/title.vue";
import Map from "./map/map.vue";

export default {
  components: {
    Title,
    Map,
  },
  created() {
    let userinfo = JSON.parse(window.localStorage.getItem("userinfo"));
    this.$store.commit("updateUserinfo", userinfo);
    if (userinfo.account != "admin") {
      this.showTip();
    }
  },
  methods: {
    showTip() {
      this.$notify.info({
        title: "提醒",
        message: "非管理员账户只有基本的地图使用和查询功能,没有增删改的权限",
        duration: 0,
      });
    },
  },
};
</script>

<style scoped>
.index-page {
  height: 100%;
  width: 100%;
}
.index-title {
  height: 8%;
  top: 0;
  background-color: white;
  position: absolute;
  border-radius: 0 0 50px 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
}
.index-main {
  height: 100%;
  position: relative;
  width: 100%;
}
</style>